/*
 * @lc app=leetcode.cn id=343 lang=cpp
 *
 * [343] 整数拆分
 */

// @lc code=start
class Solution {
public:
    int compute(int n,int ret) {
        if(n < 5) {
            return ret*n;
        }
        return compute(n-3,ret*3);
    }
    int integerBreak(int n) {
        int ret = 1;
        if(n < 4) {
            return n-1;
        }else {
            return compute(n,ret);
        }
    }
};
// @lc code=end

